Skip to content

Conversation

@bikcrum
Copy link

@bikcrum bikcrum commented May 27, 2021

Description

This is the minimal fix for typecasting error caused in null safety mode.

Implementation:

Issue:

<Widget?>[....].where((a) => a != null).toList() as List<Widget>

// causes type 'List<Widget?>' is not a subtype of type 'List<Widget>' in type cast

Fix:

<Widget?>[....].where((a) => a != null).whereType<Widget>().toList()

Effective line numbers: [435-437], [600-620]

Related Issues

#69 #70 #71 #72

@housecode
Copy link

is it ready to use at production ?

@definitelyme
Copy link

definitelyme commented Oct 23, 2021

@Dn-a can this be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants